package ${sourceBasePackage}.api;

import com.bidb.core.api.BaseEntityApi;
import com.bidb.core.dto.ResultData;
import com.bidb.core.dto.serach.PageResult;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import ${sourceBasePackage}.dto.${entityName}Dto;
import ${sourceBasePackage}.dto.${entityName}SearchDto;

import javax.validation.Valid;
import java.util.List;

/**
 * ${description}(${entityName})API
 *
 * @author ${author}
 * @since ${createDate}
 */
@Valid
@FeignClient(name = "smart-site-safety", path = ${entityName}Api.PATH)
public interface ${entityName}Api extends BaseEntityApi<${entityName}Dto> {

	String PATH = "${entityName?uncap_first}";

	/**
	 * ${description}分页查询
	 * @param ${entityName?uncap_first}SearchDto
	 * @return
	 */
	@PostMapping(path = "findByPage")
	@ApiOperation(value = "${description}分页查询", notes = "${description}分页查询")
	ResultData<PageResult<${entityName}Dto>> findByPage(@RequestBody ${entityName}SearchDto ${entityName?uncap_first}SearchDto);

	/**
     * ${description}条件查询
     * @param ${entityName?uncap_first}SearchDto
     * @return
     */
    @PostMapping(path = "findByList")
    @ApiOperation(value = "${description}条件查询", notes = "${description}条件查询")
	ResultData<List<${entityName}Dto>> findByList(@RequestBody ${entityName}SearchDto ${entityName?uncap_first}SearchDto);

	/**
     * ${description}新增
     * @param ${entityName?uncap_first}Dto
     * @return
     */
    @PostMapping(path = "add")
    @ApiOperation(value = "${description}新增", notes = "${description}新增")
    ResultData add(@RequestBody ${entityName}Dto ${entityName?uncap_first}Dto);

    /**
     * ${description}修改
     * @param ${entityName?uncap_first}Dto
     * @return
     */
    @PostMapping(path = "update")
    @ApiOperation(value = "${description}修改", notes = "${description}修改")
    ResultData update(@RequestBody ${entityName}Dto ${entityName?uncap_first}Dto);

    /**
     * ${description}删除
     * @param ${entityName?uncap_first}Dto
     * @return
     */
    @PostMapping(path = "deleteById")
    @ApiOperation(value = "${description}删除", notes = "${description}删除")
    ResultData deleteById(@RequestBody ${entityName}Dto ${entityName?uncap_first}Dto);

}
